//Generating of the good words D7
#include "stdio.h"

void printm(int x2);

int word[25]={0};
void g(int n,int k, int i,int x);
bool checkm(int x1[],int x2);

int main()
{
	for (int i=0;i<25;i++) word[i]=-1;
	int N=0,K=0;
	if (scanf("%d %d",&N,&K)!=2||N<0||K>24||0>K||K>(N+1)/2||N>24) return printf("ERROR\n"),1;
	if (!K)
	{
        for (int i=K;i<N;i++) printf("%d",0);
		printf("\n");
        return 0;
    }
	for (int i=0;i<K;i++) word[i]=1;
    for (int i=K;i<N;i++) word[i]=0;
	g(N,K,0,K+1);
	return 0;
}

bool checkm(int x2)
{
    for (int r=0;r<x2-1;r++)
    {
        if (word[r]&&word[r+1]) return false;
    }
    return true;
}

void printm(int x2)
{
	for (int w=0;w<x2;w++) printf("%d",word[w]);
	printf("\n");
}

void g(int n,int k, int i,int x)
{
    if (checkm(n)) printm(n);
    x--;
	for (int j=i;j<n-1;j++)
	{
        if (word[j+1]==1) g(n,k,j+1,x);
        if (word[j+1]==0)
            {
            word[j+1]=1;
            word[j]=0;
            if (checkm(n)) printm(n);
            }
	}
	for (int e=1;e<=x;e++) word[i+e]=1;
	for (int e=x+1;e<n-i;e++) word[i+e]=0;
	x++;

}


